<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script> -->
    <script src="../js/vue.js"></script>
    <title>Document</title>
</head>
<body>
    <div id="app">
        <h2> Vue 入门学习</h2>
        <h2 class="text">{{msg}}</h2>
        <h2 class="count">count == {{count}}</h2>
        <h2>{{txt}}</h2>

        <div v-if="flag">
            <div :data:title="title">
                {{title}}
            </div>
            <img :src="imgSrc" style="width: 200px;" alt="">
        </div>
        <div class="else" v-else>
            努力的图片           
        </div>
        <button @click="flag=!flag">点击{{flag?"隐藏":"显示"}}</button>
        <p>
            <input type="text" name="" id="" :value="msg" @input="change">
        </p>
        <p>
            <input type="text" name="" id="" v-model="msg">
        </p>
        <p>
            商品单价: <input type="text" v-model="good.price">
            <br>
            商品数量: <input type="text" v-model="good.num">
        </p>
        <p>
            商品总价:{{good.price * good.num}}
        </p>
    </div>




    <script>
        var vm = new Vue ({
            data:{
                msg:"work hard for you",
                count:"1314",
                txt:"Vue.js 的核心是一个允许采用简洁的模板语法来声明式地将数据渲染进 DOM 的系统",
                title:"好看的图片",
                imgSrc:"../../../../h_2114/h_2114_me/day028/upload1/img.png",
                flag:!!1,
                good:{
                    price:110,
                    num:50
                },



            },
            methods:{
                change(e){
                    this.msg = e.target.value
                }
            }
        }).$mount("#app")
        console.log(Vue);
    </script>
</body>
</html>